package com.designpattern.strategy;

public class ZombieTest {

    public static void main(String[] args) {
        AbstractZombie normalZombie=new NormalZombie1();
        AbstractZombie flagZombie=new FlagZombie1();
        normalZombie.display();
        normalZombie.move();
        normalZombie.attack();

        System.out.println("-------------");
        flagZombie.display();
        flagZombie.move();
        flagZombie.attack();
    }
}

abstract class AbstractZombie{
    public abstract void display();
    public void attack(){
        System.out.println("咬人");
    }
    public void move(){
        System.out.println("一步一步移动");
    }
}

class NormalZombie1 extends AbstractZombie{

    @Override
    public void display() {
        System.out.println("我是普通僵尸");
    }
}

class FlagZombie1 extends AbstractZombie{

    @Override
    public void display() {
        System.out.println("我是旗手僵尸");
    }
}

class BigHeadZombie extends AbstractZombie{

    @Override
    public void display() {
        System.out.println("大头");
    }

    @Override
    public void attack() {
        System.out.println("头撞");
    }
}